package com.example.covid19.controller;


import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.covid19.common.lang.Result;
import com.example.covid19.entity.OrderForm;
import com.example.covid19.entity.OrderInfo;
import com.example.covid19.entity.User;
import com.example.covid19.mapper.UserMapper;
import com.example.covid19.service.OrderFormService;
import com.example.covid19.service.OrderInfoService;
import com.example.covid19.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.time.LocalDateTime;
import java.util.List;
import java.util.UUID;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author BaiZhengChun
 * @since 2022-09-12
 */
@RestController
@RequestMapping("/order-info")
public class OrderInfoController {
    private final OrderInfoService orderInfoService;
    private final OrderFormService orderFormService;
    private final UserService userService;
    private final UserMapper userMapper;
    @Autowired
    StringRedisTemplate stringRedisTemplate;
    public OrderInfoController(OrderInfoService orderInfoService, OrderFormService orderFormService, UserService userService, UserMapper userMapper) {
        this.orderInfoService = orderInfoService;
        this.orderFormService = orderFormService;
        this.userService = userService;
        this.userMapper = userMapper;
    }
    @RequestMapping("/userinfo")
    public Result userinfo(HttpServletRequest request){
        return orderInfoService.userinfo(request);

    }
    @RequestMapping("/rec")
    public Result rec(@RequestParam("rec")String rec){
       return orderInfoService.rec(rec);
    }
    @RequestMapping("/gett")
    public Result gett(@RequestBody JSONArray jsonArray){
      return orderInfoService.gett(jsonArray);
    }
}
